Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle SIGINT to abort hanging queries in ValidateBuilderExists #2214

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sagnik3788
Copy link

Summary

Fix ValidateBuilderExists function to handle SIGINT signals. This update ensures that interrupted hanging queries gracefully abort, returning an "operation aborted" error

Before

Crtl+C does not abort hanging query

After

operation aborted

Resolves #1242

@sagnik3788 sagnik3788 requested review from a team as code owners July 14, 2024 18:39
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jul 14, 2024
@github-actions github-actions bot added this to the 0.35.0 milestone Jul 14, 2024
Signed-off-by: sagnik3788 <[email protected]>
Signed-off-by: sagnik3788 <[email protected]>
Signed-off-by: sagnik3788 <[email protected]>
@sagnik3788
Copy link
Author

@natalieparellano, any idea why windows-lcow and windows-wcow are failing at [Makefile:99: unit], while locally make unit passes all the cases?

@natalieparellano
Copy link
Member

@sagnik3788 I'm seeing TestConfigDefaultBuilder/ConfigDefaultBuilderCommand/#ConfigDefaultBuilder/set/SIGINT_is_received_during_query/aborts_the_operation config_default_builder_test.go:223: Expected nil: not supported by windows - I'm guessing you are developing on a Mac or Linux machine?

@sagnik3788
Copy link
Author

sagnik3788 commented Jul 15, 2024

Linux machine @natalieparellano

@natalieparellano natalieparellano modified the milestones: 0.35.0, 0.36.0 Jul 17, 2024
Comment on lines +76 to +77
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably want a separate implementation of this for linux/darwin and windows. This can be accomplished with separate files, such as signal_unix.go and signal_windows.go, and build tags as shown here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 with this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setting remote config doesn't respect Ctrl+C
3 participants